<?php
if ($_GET['action'] == 'do') {
  include("config.php");
  mysql_connect($server,$sqlusername,$sqlpassword) or die (mysql_error());
  mysql_select_db($database) or die(mysql_error());
  if (isset($_REQUEST['username']) && isset($_REQUEST['password'])) {
    $query = "INSERT INTO " . $loginTable. " (username,password) VALUES ('". $_REQUEST['username']. "','". $_REQUEST['password']. "');";
    mysql_query("$query") or die("$query");
    //header("Location:");
    
  }

}

echo "<form method = 'post' action = 'register.php?action=do'><p><h2><a name = 'register'>Register</h2>
*All fields required <br>
<table>
<tr><td>Username:</td><td><input value = '' name = 'username' type = 'text'></td></tr>
<tr><td>Password:</td><td><input value = '' name = 'password' type = 'password'></td></tr>
</table>
<input type = 'submit' name='register' value = 'Register'>
</p>
</form>";

?>
